package demo2;

public class Text {
    public static void eat(Animal a) {
        a.eat();
    }

    public static void main(String[] args) {
        Cat cat = new Cat("猫",2,21f);
        Dog dog = new Dog("狗",2,11f);

        eat(cat);
        eat(dog);
    }
}
